/*
 * File Created: 2019-12-01 11:40:02
 * Author: 余保林 (yubaolin6@outlook.com)
 * Desc: 会员管理相关接口
 * Last Modified: 2019-12-01 11:40:26
 * Modified By: 余保林 (yubaolin6@outlook.com>)
 */

import request from '@/utils/request'
import Qs from 'qs'

/**
 * 会员信息查询
 *
 * @export
 * @param {*} params
 * @returns
 */
export function memberQuery(params) {
  return request({
    url: `/platform/members/query?${Qs.stringify(params)}`,
    method: 'get'
  })
}

/**
 * 已开通的权益
 *
 * @export
 * @param {*} id
 */
export function membersPrivileges(id) {
  return request.get(`/platform/members/${id}/privileges`)
}

/**
 * 已添加的银行卡
 *
 * @export
 * @param {*} id
 */
export function membersBankcards(id) {
  return request.get(`/platform/member/${id}/bank_cards`)
}

/**
 * 个人信息
 *
 * @export
 * @param {*} id
 * @returns
 */
export function membersProfile(id) {
  return request.get(`/platform/member/${id}/profile`)
}

/**
 * 开通权益
 *
 * @export
 * @param {*} data
 * @returns
 */
export function openPrivilege(data) {
  return request.post('/platform/open/privilege', data);
}

/**
 * 常去站点
 *
 * @export
 * @param {*} id
 * @returns
 */
export function memberCinema(id, params) {
  return request.get(`/platform/member/${id}/cinemas/often?${Qs.stringify(params)}`)
}

/**
 * 权益详情
 *
 * @export
 * @param {*} id
 */
export function memberPivilegeDetails(id, params) {
  return request.get(`/platform/member/${id}/privilege/details?${Qs.stringify(params)}`)
}
